<%@ page import="java.util.Locale" %>
<%@ page import="java.util.ResourceBundle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<%
    String locale = request.getParameter("locale");
    if (locale == null) {
        locale = "zh_CN";
    }
    String[] s = locale.split("_");
    ResourceBundle rb = ResourceBundle.getBundle("res", new Locale(s[0], s[1]));
%>
<head>
    <meta charset="UTF-8">
    <title><%=rb.getString("msg.login")%>
    </title>
</head>
<body>
<a href="./login.jsp?locale=zh_CN">中文</a>
<a href="./login.jsp?locale=en_US">English</a>
<h1><%=rb.getString("msg.login")%></h1>
<form>
    <%=rb.getString("msg.username")%>：<input type="text"/><br/>
    <%=rb.getString("msg.password")%>：<input type="password"/><br/>
    <button type="submit"><%=rb.getString("msg.login")%></button>
</form>
</body>
</html>